@isTest
private class CheckforAttachment_TEST {

    static testMethod void myUnitTest() 
    {
        RecordType rec1=[Select Id From RecordType where SobjectType='Account' and IsActive=true and  Name='AAS Master Client'] ;
RecordType rec2=[Select Id From RecordType where SobjectType='Account' and IsActive=true and  Name='AAS Sales Account'] ;
Account acc1 = new Account();

    acc1.RecordTypeId =rec1.Id;
    acc1.Name = 'MasteraccountTest';
    insert acc1;
Account acc2 = new Account();
    acc2.RecordTypeId =rec2.Id;
    acc2.Master_Client__c=acc1.Id;
    acc2.Name = 'accountTest';
    insert acc2;
    Opportunity opp = new Opportunity();
    opp.RecordTypeId = RecordTypeHelper.GetRecordTypeId('Opportunity', 'Advanced Ad Solutions');
    opp.AccountId = acc2.Id;
    opp.Name = 'AAS opp test';
    opp.StageName = 'Ascertainment by AE';
    opp.CloseDate = Date.today().addDays(1);
    opp.Credit_Check_Info_Secured__c='Yes';
    opp.Contract_Start_Date__c=date.today();
    opp.Contract_Termination_Date__c=date.today();
    opp.Amount=1000;
    opp.LeadSource='Cold Call';
    insert opp;
    Attachment attch= new Attachment(Name ='Testattch', ParentId = opp.Id, Body = Blob.valueOf('This is a Test'));
    insert attch;
Opportunity_Attachments_Classification__c oppattchclass=new Opportunity_Attachments_Classification__c();
oppattchclass.Attachment_Type__c='IO';
oppattchclass.AttachmentId__c=attch.Id;
oppattchclass.Opportunity__c=opp.Id;
insert oppattchclass; 
    opp.StageName='Signed';
    update opp;

    }
}